﻿#region Copyright

//  ======================================================
//      Copyright (c) 2011 Toulr All rights reserved.
//     
//      The use and distribution terms for this software are contained in the file
//      named license.txt, which can be found in the root of this distribution.
//      By using this software in any fashion, you are agreeing to be bound by the
//      terms of this license.
//     
//     You must not remove this notice, or any other, from this software.
//  ======================================================

#endregion

#region Using Namespaces

using System.Collections.Generic;

#endregion

namespace Toulr.Domains
{
    public interface IRepository<TEntity>
        where TEntity : class, IEntity
    {
        IEnumerable<TEntity> FindAll();
        TEntity Add(TEntity entity);
        void Delete(TEntity entity);
        TEntity Update(TEntity entity);

        /// <summary>
        /// 更新对实体象中发生变化的属性
        /// </summary>
        /// <param name="entityNew"></param>
        /// <param name="entityOrig"></param>
        /// hyyu 20110515
        void Update(TEntity entityNew, TEntity entityOrig);
    }
}